﻿<Window x:Class="P2.Cuberry.Modules.SimpleCRM.CRCorrespondence.CRCorrespondencesDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
    xmlns:basec="clr-namespace:P2.Cuberry.Framework.Helper;assembly=P2.Cuberry.Framework.Helper" 
        
        Icon="/P2.Cuberry;component/Images/CuberryIcon32.ico"
        Title="Peacequare Cuberry" Width="920" Height="480"  
        Background="{DynamicResource P2BackgroundBrush}" 
        Closing="Window_Closing"
        >

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <Grid.Resources>
            <Image x:Key="SaveIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleCRM.CRCorrespondence;component/Images/save.png" />
            <Image x:Key="CancelIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleCRM.CRCorrespondence;component/Images/cancel.png" />
            <Image x:Key="ClosingIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleCRM.CRCorrespondence;component/Images/save.png" />

            <Image x:Key="Printer2Icon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleCRM.CRCorrespondence;component/Images/printer2.png" />


        </Grid.Resources>


        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>

        <!-- Row 0 Start -->
        
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Content="{Translate DialogHeaderCRCorrespondenceDetail}" Style="{StaticResource P2DetailViewHeaderTextStyle}" />
        
        <Separator Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="0"/>
        <!-- Row 0 End -->

        <!-- Row 1: Menu Start -->
        <Border  Grid.Row="1" Grid.Column="0"  Style="{StaticResource P2MenuBorderStyle}">
            <Grid>
            <Menu Grid.Row="1" x:Name="menuMain" Style="{StaticResource P2MenuStyle}" >
                <MenuItem x:Name="SaveBtn" Margin="2,1,0,2"  InputGestureText="Ctrl+S" Header="{Translate SaveBtn}" Command="{Binding CRCorrespondenceSaveCommand}"  Icon="{StaticResource SaveIcon}" Style="{StaticResource P2MenuItemStyle}" />
                <MenuItem x:Name="CloseBtn" Margin="2,1,0,2" InputGestureText="Ctrl+X" Header="{Translate SaveAndCloseBtn}" Command="{Binding CRCorrespondenceCloseCommand}" Icon="{StaticResource CancelIcon}" Style="{StaticResource P2MenuItemStyle}"/>
                                
                <MenuItem x:Name="PrintBtn" Margin="2,1,0,2" Header="{Translate PrintBtn}" Click="PrintBtn_Click" Icon="{StaticResource Printer2Icon}" Style="{StaticResource P2MenuItemStyle}"/>

            </Menu>
                <Menu Grid.Row="1" HorizontalAlignment="Right" x:Name="menuMainRight" Style="{StaticResource P2MenuStyle}" >
                    <MenuItem x:Name="HistoryBtn" Command="{Binding HistoryCommand}"  Style="{StaticResource P2MenuItemStyleHistory}"/>
                    <MenuItem x:Name="InfoBtn" Command="{Binding InfoCommand}"  Style="{StaticResource P2MenuItemStyleInfo}"/>
                </Menu>
            </Grid>
        </Border>


        <!-- Row 1 End -->

        <!-- Row 2: All Fields -->
        <Border  Grid.Row="2" Grid.Column="0"  Style="{StaticResource P2ContentBorderStyle}">
            <Grid Grid.Row="2" Grid.Column="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="604*"/>
                    <ColumnDefinition Width="0*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Label Margin="22,14,0,0" Name="DocumentNameL" Height="28" VerticalAlignment="Top" Content="{Translate DocumentNameL}" HorizontalAlignment="Left" Width="120"></Label>
                <TextBox Margin="22,35,0,0" Name="DocumentName" Height="23" Text="{Binding Model.DocumentName, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="247.47" />
                
                <Label Content="{Translate DocumentTypeL}" Height="28" HorizontalAlignment="Left" Margin="22,56,0,0" Name="DocumentTypeL" VerticalAlignment="Top" Width="120" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="22,78,0,0" Name="DocumentType" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.DocumentType, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalAlignment="Top" Width="247.47" />
                
                <Label Content="{Translate SubjectL}" Height="28" HorizontalAlignment="Left" Margin="22,99,0,0" Name="SubjectL" VerticalAlignment="Top" Width="120" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="22,120,0,0" Name="Subject" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.Subject, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalAlignment="Top" Width="247.47" />
                
                <Label Margin="22,158,0,0" Content="{Translate OrganisationIDL}" Name="OrganisationIDL" HorizontalAlignment="Left" Width="106.47" Height="27.723" VerticalAlignment="Top" />
                <ComboBox Margin="22,178,0,0" DisplayMemberPath="OrganisationNameCur" Name="OrganisationID" SelectedValuePath="OrganisationID" SelectedValue="{Binding OrganisationID, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" ItemsSource="{Binding Organisations}" IsEnabled="{Binding IsEditable}" Style="{StaticResource P2ComboBoxStyle}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Height="23.723" VerticalAlignment="Top" HorizontalAlignment="Left" Width="198" />
                
                <Label Margin="22,214,0,0" Content="{Translate ContactIDL}" Name="ContactIDL" HorizontalAlignment="Left" Width="106.47" Height="28" VerticalAlignment="Top" />
                <ComboBox Margin="22,234.277,0,0" DisplayMemberPath="ContactNameCur" Name="ContactID" SelectedValuePath="ContactID" SelectedValue="{Binding ContactID, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" ItemsSource="{Binding Contacts}" IsEnabled="{Binding IsEditable}" Style="{StaticResource P2ComboBoxStyle}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Height="23.723" VerticalAlignment="Top" HorizontalAlignment="Left" Width="198" />
                
                
                <Label Margin="0,14,69,0" Name="DocumentDescriptionL" Height="28" VerticalAlignment="Top" Content="{Translate DocumentDescriptionL}" HorizontalAlignment="Right" Width="347"></Label>
                <TextBox Margin="0,35,69,0" Name="DocumentDescription" Height="23" Text="{Binding Model.DocumentDescription, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}" VerticalAlignment="Top" HorizontalAlignment="Right" Width="347" />
                
                <Label Content="{Translate DocumentDateL}" Height="27.723" HorizontalAlignment="Right" Margin="0,99.277,299,0" Name="DocumentDateL" VerticalAlignment="Top" Width="120" />
                <DatePicker Height="23.723" HorizontalAlignment="Right" Margin="0,119.277,309,0" Name="DocumentDate" SelectedDate="{Binding Model.DocumentDate, Mode=TwoWay}" VerticalAlignment="Top" Width="107" xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit" />
            </Grid>
        </Border>

        <!-- Row 2: End -->


        <!-- Row 3: Bottom: Status Bar Start -->
        <Border Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripBorderStyle}" >
            <Grid Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripGridStyle}">
                <basec:P2StatusStrip x:Name="StatusStrip" MessageStack2="{Binding MessageStack}"  Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Left" ContentStringFormat=""></basec:P2StatusStrip>
                <TextBox Name="Status" Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Right" Text="{Binding Model.StatusName, Mode=OneWay}" IsReadOnly="True" BorderBrush="Transparent" />
            </Grid>
        </Border>

        <!-- Row 3: End -->
    </Grid>
</Window>
